<template>
  <div class="box">
    <video muted autoplay loop
      style="position: absolute;object-fit: fill; width: 100%; height: calc(100% - 4px);z-index: 990;">
      <source src="../../assets/index/bg.mp4" type="video/mp4" />
    </video>

    <!-- <headerPage :title="title" :index="index"></headerPage> -->

    <div class="context">
      <div class="c_left">
        <div class="cl_item">
          <div class="title">订单产品</div>
          <event-source-page></event-source-page>
        </div>
        <div class="cl_item">
          <div class="title">已分配工序</div>
          <event-urgency-page></event-urgency-page>
        </div>
        <div class="cl_item">
          <div class="title">顶单已排产</div>
          <event-type-page></event-type-page>
        </div>

      </div>
      <div class="c_middle">

        <div class="cl_item cl_item3" style="height: 22%">
          <div class="title" style="display: flex; justify-content: space-around;height: 49%;padding: 0.1rem 0.05rem;">
            <div class="number">
              <div style="font-size: 0.12rem">{{ wgyReportCount + peopleReportCount }}</div>
              <div style="display: flex; justify-content: center; align-items: center">
                <div style="width: 8px;background-color: #0d90ef; border-radius: 4px; height: 18px"></div>
                <div style="margin-left: 4px;font-size: 0.09rem">订单产品数量</div>
              </div>
            </div>
            <div class="number">
              <div style="font-size: 0.12rem">{{ wgyReportCount }}</div>
              <div style="display: flex; justify-content: center; align-items: center">
                <div style="width: 8px;background-color: #1bc5ea; border-radius: 4px; height: 18px"></div>
                <div style="margin-left: 4px;font-size: 0.09rem">待产拆解产品</div>
              </div>
            </div>
            <div class="number">
              <div style="font-size: 0.12rem">{{ peopleReportCount }}</div>
              <div style="display: flex; justify-content: center; align-items: center">
                <div style="width: 8px;background-color: #0d90ef; border-radius: 4px; height: 18px"></div>
                <div style="margin-left: 4px;font-size: 0.09rem">待分配工序</div>
              </div>
            </div>
            <div class="number">
              <div style="font-size: 0.12rem">{{ finishWgy }}</div>
              <div style="display: flex; justify-content: center; align-items: center">
                <div style="width: 8px;background-color: #1bc5ea; border-radius: 4px; height: 18px"></div>
                <div style="margin-left: 4px;font-size: 0.09rem">已分配工序</div>
              </div>
            </div>
            <div class="number">
              <div style="font-size: 0.12rem">{{ finishTown }}</div>
              <div style="display: flex; justify-content: center; align-items: center">
                <div style="width: 8px;background-color: #efbe0d; border-radius: 4px; height: 18px"></div>
                <div style="margin-left: 4px;font-size: 0.09rem">订单待排产</div>
              </div>
            </div>

          </div>
          <div class="title" style="display: flex; justify-content: space-around;height: 49%;padding: 0.05rem 0.05rem;">
            <div class="number">
              <div style="font-size: 0.12rem">{{ acceptHotLine + finishHotline + report + reject }}</div>
              <div style="display: flex; justify-content: center; align-items: center">
                <div style="width: 8px;background-color: #06f506; border-radius: 4px; height: 18px"></div>
                <div style="margin-left: 4px;font-size: 0.09rem">订单已排产</div>
              </div>
            </div>
            <div class="number">
              <div style="font-size: 0.12rem">{{ report }}</div>
              <div style="display: flex; justify-content: center; align-items: center">
                <div style="width: 8px;background-color: #efbe0d; border-radius: 4px; height: 18px"></div>
                <div style="margin-left: 4px;font-size: 0.09rem">自制产品</div>
              </div>
            </div>

            <div class="number">
              <div style="font-size: 0.12rem">{{ acceptHotLine }}</div>
              <div style="display: flex; justify-content: center; align-items: center">
                <div style="width: 8px;background-color: #efbe0d; border-radius: 4px; height: 18px"></div>
                <div style="margin-left: 4px;font-size: 0.09rem">生产订单</div>
              </div>
            </div>
            <div class="number">
              <div style="font-size: 0.12rem">{{ reject }}</div>
              <div style="display: flex; justify-content: center; align-items: center">
                <div style="width: 8px;background-color: red; border-radius: 4px; height: 18px"></div>
                <div style="margin-left: 4px;font-size: 0.09rem">待生产产品</div>
              </div>
            </div>

            <div class="number">
              <div style="font-size: 0.12rem">{{ finishHotline }}</div>
              <div style="display: flex; justify-content: center; align-items: center">
                <div style="width: 8px;background-color: #06f506; border-radius: 4px; height: 18px"></div>
                <div style="margin-left: 4px;font-size: 0.09rem">库存生产单</div>
              </div>
            </div>


          </div>
        </div>

        <div class="cl_item" style="height: 36%">
          <div class="title">质检情况</div>
          <event-dept-count-page></event-dept-count-page>
        </div>
        <div class="cl_item" style="height: 42%">
          <div class="title">库存入库情况</div>
          <event-dept-count-list></event-dept-count-list>
        </div>
      </div>

      <div class="c_right">
        <div class="cl_item" style="height: 65%">
          <div class="title" style="padding-top: 0.23rem">报工记录</div>
          <event-dept-status-list></event-dept-status-list>
        </div>

        <div class="cl_item">
          <div class="title">生产订单完成情况</div>
          <event-trend-page></event-trend-page>
        </div>
      </div>
    </div>

    <event-list-page ref="eventListPage"></event-list-page>

  </div>
</template>

<script>
// import headerPage from "./headerEvent";
import request from "@/utils/request";
import {getAction} from "../../api/manage";
// import EventListPage from "./eventListPage";
import EventSourcePage from "@/views/nav/modules/EventSourcePage";
import EventUrgencyPage from "@/views/nav/modules/EventUrgencyPage";
import EventTypePage from "@/views/nav/modules/EventTypePage";
import EventDeptCountPage from "@/views/nav/modules/EventDeptCountPage";
import EventDeptCountList from "@/views/nav/modules/EventDeptCountList";
import EventTrendPage from "@/views/nav/modules/EventTrendPage";
import EventDeptStatusList from "@/views/nav/modules/EventDeptStatusList";



export default {
  name: "navPage",
  components:{
    EventDeptStatusList,
    EventTrendPage,
    EventDeptCountList,
    EventDeptCountPage,
    EventTypePage,
    EventUrgencyPage,
    EventSourcePage,
    // headerPage,
    // EventListPage,
  },
  data() {
    return {
      title: "“任诚办”大数据统计",
      date: "",
      nowTime: '',
      nowDate: '',
      nowWeek: '',
      index: "1",
      partySignCountList: [],
      statusDataList: [],
      allDataCount: {},
      map: null,
      committeeDataList: [],
      unverify: 0,
      town: 0,
      acceptHotLine: 0,
      report: 0,
      finish: 0,
      reject: 0,

      finishWgy: 0,
      finishTown: 0,
      finishHotline: 0,
      peopleReportCount: 0,
      wgyReportCount: 0,
    }
  },
  mounted() {
    this.flexible();
    // this.getStatusAllCount();
    // this.getFinishTypeCount();
    // this.getWgyReportCount();
    // this.getPeopleReportCount();
  },
  created() {
  },
  methods: {
    flexible() {
      let htmlWidth = document.documentElement.clientWidth || document.body.clientWidth;
      // 获取html的dom
      let htmlDom = document.getElementsByTagName('html')[0];
      // 设置html的font-size
      htmlDom.style.fontSize = htmlWidth / 10 + 'px';
      window.addEventListener('resize', (e) => {
        let htmlWidth = document.documentElement.clientWidth || document.body.clientWidth;
        htmlDom.style.fontSize = htmlWidth / 10 + 'px';
      });
    },

    getWgyReportCount() {
      let that = this;
      that.loading = true;
      let params = {};
      getAction('/statistic/event/wgyReportCount', params).then(response => {
        this.wgyReportCount = response.data;
      })
    },

    getPeopleReportCount() {
      let that = this;
      that.loading = true;
      let params = {};
      getAction('/statistic/event/peopleReportCount', params).then(response => {
        this.peopleReportCount = response.data;
      })
    },

    getStatusAllCount() {
      let that = this;
      let params = {
        types: "sub,closed,acceptWgy,town,acceptTown,report,acceptHotLine,finish,reject,finishWgy,finishTown,finishHotline"
      };
      getAction('/statistic/event/getStatusDataCount', params).then(response => {
        // 0待网格员核实 1热线退回 2办理中 3未派发 4已办结 5镇(街道)核实办理 6已关闭 7已上报热线 8已归档 9审核不通过 10已派发 11 网格员未核实
        let data = response.data;
        that.sub = data['sub'];
        that.finishHotline = data['finishHotline'];
        that.acceptWgy = data['acceptWgy'];
        that.town = data['town'];
        that.acceptHotLine = data['acceptHotLine'];
        that.reject = data['reject'];
        that.acceptTown = data['acceptTown'];
        that.finishTown = data['finishTown'];
        that.report = data['report'];
        that.closed = data['closed'];
        that.finishWgy = data['finishWgy'];
        that.finish = data['finish'];
      });
    },

  }
}
</script>
<style scoped lang="scss">
* {
  font-size: 0.1rem;
}

.box {
  width: 100%;
  height: 100%;
  position: relative;
  background: url("../../assets/index/bg1.png") no-repeat;
  background-size: 100% 100%;
  padding-top: 0.01rem;
  overflow: hidden;
}

.context {
  width: 98%;
  height: calc(100% - 80px);
  position: absolute;
  z-index: 990;
  top: 55%;
  left: 50%;
  transform: translate(-50%, -50%);
  -ms-transform: translate(-50%, -50%);
  /* IE 9 */
  -moz-transform: translate(-50%, -50%);
  /* Firefox */
  -webkit-transform: translate(-50%, -50%);
  /* Safari 和 Chrome */
  -o-transform: translate(-50%, -50%);
  /* Opera */
  display: flex;
  justify-content: space-between;

  /* padding: 0.2rem;
   border-radius: 0.2rem;*/
  .c_left,
  .c_right {
    width: 29%;
    height: 100%;
    padding: 0.05rem 0;
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    align-items: center;

    .opea_box {
      width: 100%;
      height: 40px;
      //position: absolute;
      top: -3px;
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: center;

      .btn_item {
        width: 80px;
        height: 35px;
        line-height: 35px;
        text-align: center;
        color: #0EBADD;
        background: rgba(14, 186, 221, 0.5);
        cursor: pointer;
        font-size: 15px;
        font-weight: bold;
        text-stroke: 3px #FFF;
      }

      .btn_active {
        color: #FFCC2F;
        background: rgba(255, 204, 47, 0.5);
      }

      .btn_item:nth-child(1) {
        border-radius: 15px 15px 15px 15px;
      }

      .btn_item:nth-child(2) {
        border-radius: 0 15px 15px 0;
      }
    }

    ::v-deep .con {
      width: 100%;
      height: calc(100% - 0.35rem);

      .bar_item {
        width: 100%;
        height: 0.2rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 20px;
        color: #FFFFFF;

        .item_left {
          width: 135%;
          height: 100%;
          line-height: inherit;
          text-align: center;
          font-size: 0.02rem;
          padding-left: 0.1rem;
          position: relative;
        }

        .tip {
          display: inline-block;
          width: 0.1rem;
          height: 0.1rem;
          line-height: 0.1rem;
          text-align: center;
          background-color: #3D8FFF;
          position: absolute;
          top: 50%;
          left: 7px;
          transform: translate(-50%, -50%);
          font-size: 0.07rem;
          font-weight: bold;
          border-radius: 0.02rem;
          z-index: 999
        }

        .tip:after {
          display: block;
          content: "";
          width: 0rem;
          height: 0rem;
          border: 0.03rem solid transparent;
          border-left-color: #3D8FFF;
          position: absolute;
          top: 0.02rem;
          left: 0.09rem;
          z-index: 99
        }

        .item_middle {
          width: 74%;
          height: 100%;
          line-height: 0.13rem;
          margin-left: 25px;
        }

      }

      .bar_item:nth-child(1) .tip {
        background-color: #FF3232;
      }

      .bar_item:nth-child(2) .tip {
        background-color: #FF9800;
      }

      .bar_item:nth-child(3) .tip {
        background-color: #FFD200;
      }

      .bar_item:nth-child(1) .tip:after {
        border-left-color: #FF3232;
      }

      .bar_item:nth-child(2) .tip:after {
        border-left-color: #FF9800;
      }

      .bar_item:nth-child(3) .tip:after {
        border-left-color: #FFD200;
      }
    }

    .cl_item {
      width: 100%;
      height: 32%;
      background: url("../../assets/index/k3.png") no-repeat;
      background-size: 100% 100%;

      .title {
        width: 100%;
        height: 0.3rem;
        color: #FFFFFF;
        text-align: center;
        padding: 0.15rem 0.05rem;
      }
    }


  }

  .c_middle {
    width: 43%;
    height: 100%;
    padding: 0.05rem 0;
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    align-items: center;

    .cl_item {
      width: 100%;
      height: 48%;
      background: url("../../assets/index/k4.png") no-repeat;
      background-size: 100% 100%;

      .title {
        width: 100%;
        height: 0.3rem;
        color: #FFFFFF;
        text-align: center;
        padding: 0.15rem 0.05rem;

        .number {
          cursor: pointer;
          width: 20%;
          //width: 120px;
        }
      }
    }

    .cl_item3 {
      width: 98%;
      height: 30%;
      background: url("../../assets/index/border.png") no-repeat;
      background-size: 98% 100%;
      padding: 0;
      margin-left: 1.5%;
    }

    ::v-deep .con {
      width: 100%;
      height: calc(100% - 0.35rem);

    }

  }
}
</style>
<style>
.p_bar .el-progress__text {
  color: #FFFFFF;
}
</style>
<style scoped lang="scss">
* {
  font-size: 0.1rem;
}

.head {
  width: 100%;
  height: 0.6rem;
  position: relative;

}

.header {
  width: 100%;
  height: 0.5rem;
  line-height: 0.5rem;
  text-align: center;
  margin: 0rem auto 0 auto;
  position: relative;
  background: url("../../assets/index/top.png") no-repeat;
  background-size: cover;
  color: #00D3FF;
  text-shadow: 0px 3px 4px rgba(29, 94, 241, 0.6000);
  font-size: 0.2rem;

  .exit_box {
    width: 2.7rem;
    height: 0.25rem;
    line-height: 0.25rem;
    text-align: right;
    color: #FFFFFF;
    display: flex;
    justify-content: space-between;
    position: absolute;
    top: 56%;
    right: 1%;
    transform: translate(0%, -50%);
    -ms-transform: translate(0%, -50%);
    /* IE 9 */
    -moz-transform: translate(0%, -50%);
    /* Firefox */
    -webkit-transform: translate(0%, -50%);
    /* Safari 和 Chrome */
    -o-transform: translate(0%, -50%);

    /* Opera */
    .btn_item {
      width: 32%;
      height: 0.25rem;
      line-height: 0.25rem;
      color: #0EBADD;
      font-size: 0.1rem;
      padding-left: 0.15rem;
      text-align: center;
      cursor: pointer;
      background: url("../../assets/index/card1.png") no-repeat;
      background-size: cover;
    }

    .btn_item1 {
      color: #FFCC2F !important;
      font-weight: bold;
      background: url("../../assets/index/card2.png") no-repeat !important;
      background-size: cover !important;
    }
  }

  .date_box {
    width: 2.7rem;
    height: 0.25rem;
    line-height: normal;
    text-align: right;
    color: #FFFFFF;
    display: flex;
    justify-content: space-between;
    position: absolute;
    top: 56%;
    left: 1%;
    transform: translate(0%, -50%);
    -ms-transform: translate(0%, -50%);
    /* IE 9 */
    -moz-transform: translate(0%, -50%);
    /* Firefox */
    -webkit-transform: translate(0%, -50%);
    /* Safari 和 Chrome */
    -o-transform: translate(0%, -50%);

    /* Opera */
    .btn_item {
      width: 32%;
      height: 0.25rem;
      color: #0EBADD;
      font-size: 0.1rem;
      padding-left: 0.15rem;
      line-height: 0.25rem;
      text-align: center;
      cursor: pointer;
      background: url("../../assets/index/card1.png") no-repeat;
      background-size: cover;
    }

    .btn_item1 {
      color: #FFCC2F !important;
      font-weight: bold;
      background: url("../../assets/index/card2.png") no-repeat !important;
      background-size: cover !important;
    }

  }

}

.c-box {
  width: 2rem;
  height: 0.3rem;
  position: absolute;
  //top: 6px;
  left: 14%;
  //transform: translate(-50%,0%);
  //display: flex;
  font-size: 0.1rem;
  align-items: center;
  color: #ffff43;

  .citem {
    font-weight: bold;
    width: 0.65rem;
    height: 0.25rem;
    line-height: 0.25rem;
    text-align: center;
    margin-left: 0.05rem;
    cursor: pointer;
    background: url("../../assets/index/938@2x.png") no-repeat;
    background-size: 100% 100%;

  }
}
</style>
<style>
.socialDetail {
  font-size: initial
}
</style>
